﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Sunny.UI;

namespace TestProject
{
    public partial class frmMain : UIAsideMainFrame
    {
        public frmMain()
        {
            InitializeComponent();

            int pageIndex = 1000;
            TreeNode parent = Aside.CreateNode("库表操作", 61961, 24, pageIndex);

            //通过设置PageIndex关联，节点文字、图标由相应的Page的Text、Symbol提供
            Aside.CreateChildNode(parent, AddPage(new frmDbFirst(), ++pageIndex));
            Aside.CreateChildNode(parent, AddPage(new frmCodeFirst(), ++pageIndex));
            Aside.CreateChildNode(parent, AddPage(new frmCodeGenerator(), ++pageIndex));

            pageIndex = 2000;
            parent = Aside.CreateNode("实用工具", 61787, 24, pageIndex);
            Aside.CreateChildNode(parent, AddPage(new frmCamera(), ++pageIndex));
            Aside.CreateChildNode(parent, AddPage(new frmImageOperate(), ++pageIndex));
            Aside.CreateChildNode(parent, AddPage(new frmZip(), ++pageIndex));
            Aside.CreateChildNode(parent, AddPage(new frmImportExport(), ++pageIndex));

            //pageIndex = 3000;
            //parent = Aside.CreateNode("接口测试", 61787, 24, pageIndex);
            //Aside.CreateChildNode(parent, AddPage(new Form1(), ++pageIndex));
            //Aside.CreateChildNode(parent, AddPage(new Form2(), ++pageIndex));

            //显示默认界面
            //AddPage(new frmCamera(), ++pageIndex)
            //Aside.SelectFirst();

        }

        /// <summary>
        /// 关闭窗体后,退出程序进程
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void frmMain_FormClosed(object sender, FormClosedEventArgs e)
        {
            //退出当前程序进程
            Application.Exit();
        }
    }
}
